package com.chen.webservice.Utils;

import com.chen.webservice.model.Order;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description: 规则100 原创节目相关约束1
 * @params: 
 * @return:  
 * @author: chenzhiwen
 * @dateTime: 2021/10/21 下午7:16
 */
@Service
public class OriginHandler implements RuleHandler {
    private static final int factor = 20;//系数

    private static final int ruleNum = 100;

    @Override
    public int ruleNum(){
        return this.ruleNum;
    }

    @Override
    public boolean isMatch(List<Integer> rules) {
        return rules.contains(ruleNum);//强校验
    }

    @Override
    public int checkResult(List<Order> orders, int rate) {
        rate = 0;
        int len = orders.size();
        if (len <= 1) {
            return rate;
        }
        for (int i = 0; i < len; i++) {
            Order order = orders.get(i);
//            if(order.get)

        }
        return rate * factor;
    }
}
